<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Home extends CI_Controller {

	function __construct()
	{
		parent::__construct();
		$this->load->model('Produk_model');
		$this->load->model('Order_model');
		$this->load->model('Konten_model');
		$this->load->library('session');
		$this->load->helper('url');
		$this->load->helper('bantuan_helper');
		$this->load->helper('topkonten_helper');
		
	}
	

	function index()
	{
		$data['current1'] = 'current'; // FOR MENU
		// Top konten
		$this->db->where('brand_slidepage','enable');
		$qr = $this->db->get('tb_brand');
		$data['arr_brand'] = $qr->result_array();
		$data['count_brand'] = count($data['arr_brand']);
		
		// sesuaikan pixel slide
		if ($data['count_brand'] == 1):
			$data['pixel'] = 535;
		elseif ($data['count_brand'] == 2):
			$data['pixel'] = 485;
		elseif ($data['count_brand'] == 3):
			$data['pixel'] = 435;
		elseif ($data['count_brand'] == 4):
			$data['pixel'] = 385;
		endif;
		
		$data['title'] = 'Home';
		$data['ses_id'] = $this->session->userdata('session_id');
		$data['page'] = 'home';
                
        // GET NEWSTICKER DATA
		 $data['arr_tick'] = $this->Konten_model->getKonten('ticker',FALSE,FALSE,FALSE,FALSE);
                
        //USE FUNCTION FRO MODEL getKatProdHome($id_brand=FALSE,$level=FALSE,$look=FALSE,$caps=FALSE)
         
        // GET  CATEGORY FOR POPEYE 1
        $data['arr_pop1'] = $this->Produk_model->getKatProdHome('1','3','1','right');
                
        // GET  CATEGORY FOR POPEYE 2
        $data['arr_pop2'] = $this->Produk_model->getKatProdHome('1','3','1','right');
		
		// GET  CATEGORY FOR POPEYE 3
        $data['arr_pop3'] = $this->Produk_model->getKatProdHome('1','3','1','right');
		
		// GET  CATEGORY FOR POPEYE 4
        $data['arr_pop4'] = $this->Produk_model->getKatProdHome('2','3','1','right');
		
		// GET  CATEGORY FOR POPEYE 5
        $data['arr_pop5'] = $this->Produk_model->getKatProdHome('5','3','1','right');
		
		// GET  CATEGORY FOR POPEYE 6
        $data['arr_pop6'] = $this->Produk_model->getKatProdHome('9','3','1','right');
		
		// GET DATA PRODUK PROMO
		
		$data['arr_promo'] = $this->Produk_model->getProduk('promo_home',FALSE,FALSE,FALSE,FALSE,FALSE);
                
	
		$data['main_view'] = 'slak/home';
		$this->load->view('/slak/index',$data);
	
	}
	
	
}



/* End of file home.php */
/* Location: ./system/application/controllers/home.php */